package com.example.controller;

import com.example.common.Result;
import com.example.service.SReportService;
import com.example.vo.SOrderDailyCountVO;
import com.example.vo.SReportVO;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
@Api(tags = "报表相关接口",value = "报表相关接口")
public class SReportController {
    @Autowired
    SReportService sReportService;
    @GetMapping
    public Result<List<SReportVO>> getMonthlySalesReport(){
        List<SReportVO> sales = sReportService.getSales();
        return Result.success(sales);
    }

    @GetMapping("/Daily")
    public Result<List<SOrderDailyCountVO>> getDailyCount(){
        List<SOrderDailyCountVO> dailyCount = sReportService.getDailyCount();
        return Result.success(dailyCount);
    }
}
